Grades 10-12 | AI & Mobile Development
Follow these steps to get your own free Gemini API key:
⚠️ Important: Keep your API key private! Never share it in public repositories or with others.
Password:
💡 Tip: These credentials are already loaded. You'll use them when building your app blocks. Keep them safe!
A chatbot is a computer program that simulates human conversation through text or voice interactions.
Siri, Alexa, customer service bots, ChatGPT, virtual assistants on websites
24/7 availability, instant responses, handle multiple conversations, automate repetitive tasks
Created by MIT to help anyone build mobile apps without traditional coding experience
Drag and drop blocks like puzzle pieces to create app logic and functionality
Built-in AI features like ChatBot, speech recognition, and image classification
Simple, clean interface with speech input/output and AI conversation
💡 Tip: All these components can be found in the Designer view's Palette on the left side
when speakButton.Click
do SpeechRecognizer1.GetText
When the user clicks the "SPEAK" button, it activates the phone's speech recognition to listen to what they say.
Like pressing a microphone button to start recording your voice - the app is now listening!
when SpeechRecognizer1.AfterGettingText
do set speakTextBox.Text to result
set responseTextBox.Text to ""
call ChatBot1.Converse
question: speakTextBox.Text
After speech is converted to text, this block:
when sendButton.Click
do if speakTextBox.Text is not empty
then call Notifier1.ShowProgressDialog
message: "Generating a response"
title: "Please wait..."
call ChatBot1.Converse
question: speakTextBox.Text
When clicking "SEND TO GEMINI":
when ChatBot1.GotResponse
do call Notifier1.DismissProgressDialog
set responseTextBox.Text to get response
When Gemini AI finishes thinking and responds:
Like waiting for a friend to text back - when they reply, you see their message!
when readButton.Click
do call TextToSpeech1.Speak
message: responseTextBox.Text
When clicking the "READ" button, it uses text-to-speech to read the AI's response out loud.
Now you can have a fully voice-based conversation: speak your question, get a text response, and have it read back to you!
Phone starts listening to what you say
Speech is converted to text, then automatically sent to AI
"Please wait..." dialog shows, Gemini generates response
Dialog closes, AI's response is displayed on screen
Response is spoken aloud through text-to-speech!
Add all the buttons and text boxes to match the design
Add the invisible components (SpeechRecognizer, TextToSpeech, ChatBot, Notifier)
Build the 5 code blocks we just learned about!
Questions? Insights? Debates?
Let's discuss! 💬
Ready to create amazing AI applications? 🚀